// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Mint from 'mint-ui';
import 'mint-ui/lib/style.css'
import VueClipboard from 'vue-clipboard2'


Vue.use(VueClipboard)
Vue.use(Mint);
Vue.config.productionTip = false
import { MessageBox } from "mint-ui";
import vconsole from './assets/js/vconsole'
import { ajaxGet, ajaxPost } from './api1/axios'
Vue.prototype.$ajaxGet = ajaxGet;
Vue.prototype.$ajaxPost = ajaxPost;
import store from './store/index';
/* eslint-disable no-new */
router.afterEach(() => {
    window.scrollTo(0, 0);
})
router.beforeEach((to, from, next) => {
    next();
    // console.log(to)
    // if (to.path == '/mine' && !localStorage.getItem('userinfo')) {
    //     MessageBox.confirm('你还没有登录，去登录？').then(action => {
    //         var u = navigator.userAgent;
    //         var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android终端
    //         var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    //         if (isAndroid) {
    //             window.bjsLauncher.logoff();
    //         } else if (isiOS) {
    //             window.location.href = "exit";
    //         } else {}
    //     });
    // } else {
    //     next();
    // }
});

new Vue({
    el: '#app',
    router,
    store,
    components: {
        App
    },
    template: '<App/>'
})